<!DOCTYPE html>
<!--
Copyright (c) 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/model/comment_box_annotation.html">
<link rel="import" href="/tracing/model/location.html">
<link rel="import" href="/tracing/model/model.html">
<link rel="import" href="/tracing/model/rect_annotation.html">
<link rel="import" href="/tracing/model/x_marker_annotation.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  test('rectAnnotation', function() {
    const fakeYComponents1 = [{stableId: '1.2', yPercentOffset: 0.3}];
    const fakeYComponents2 = [{stableId: '1.2', yPercentOffset: 0.9}];
    const start = new tr.model.Location(50, fakeYComponents1);
    const end = new tr.model.Location(100, fakeYComponents2);
    const rectAnnotation = new tr.model.RectAnnotation(start, end);
    assert.strictEqual(rectAnnotation.startLocation, start);
    assert.strictEqual(rectAnnotation.endLocation, end);
  });

  test('xMarkerAnnotation', function() {
    const xMarkerAnnotation = new tr.model.XMarkerAnnotation(90);
    assert.strictEqual(xMarkerAnnotation.timestamp, 90);
  });

  test('commentBoxAnnotation', function() {
    const fakeYComponents = [{stableId: '1.2', yPercentOffset: 0.5}];
    const location = new tr.model.Location(120, fakeYComponents);
    const text = 'abc';
    const commentBoxAnnotation =
        new tr.model.CommentBoxAnnotation(location, text);
    assert.strictEqual(commentBoxAnnotation.location, location);
    assert.strictEqual(commentBoxAnnotation.text, text);
  });
});
</script>
